#include <iostream>
#include "thread.h"

void workFunction(void)
{
    for(int i = 0; i < 5; i++)
    {
        std::cout << "workFunction::run" << std::endl;
        sleep(1);
    }
}

class WorkClass
{
public:
    void work(void);
};

void WorkClass::work(void)
{
    for(int i = 0; i < 5; i++)
    {
        std::cout << "WorkClass::work" << std::endl;
        sleep(2);
    }
}

int main()
{
    Thread t1(std::bind(workFunction));

    WorkClass work;
    Thread t2(std::bind(&WorkClass::work, &work));

    t1.start();
    t2.start();
    t1.join();
    t2.join();
    return 0;
}
